Page({
  data: {
    id: null,
    current: 0,
    tabs: [{
        text: '详细信息',
      },
      {
        text: '处理信息',
      },
      {
        text: '流程信息',
      },
      {
        text: '历史信息',
      },
      {
        text: '延期信息',
      }
    ]
  },
  onLoad(option) {
    const {
      id,
      isDelay,
      currentPage
    } = option
    if (id) {
      this.setData({
        id
      })
    }
    if (isDelay === 'true') {
      const {
        tabs
      } = this.data
      const newTabs = [...tabs, {
        text: '延期流程',
      }]
      this.setData({
        tabs: newTabs
      })
    }
    const current = Number(currentPage)
    if (current && current < this.data.tabs.length) {
      this.setData({
        current
      })
    }

  },
  handleChange(index) {
    this.setData({
      current: index
    });
  },
});